package com.bee.bootstrap.user.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.bee.bootstrap.user.entity.User;
import com.bee.common.core.result.Result;
import org.jose4j.lang.JoseException;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author liekkas
 * @since 2018-04-09
 */
public interface IUserService extends IService<User> {

    User findUserByPhone(String phone);

    User findUserByToken(String token);

    User findUserByUserName(String userName);

    List<User> findUsersByRoleId(Long roleId);

    Result findPageView(Page<User> page, User user);

    Result login(String userName, String passWord);

    Result updateLocation(String token, String province, String city, String code);

    Result saveAppToken(String phone, String code) throws JoseException;

    Result updateAppToken(String token, String phone, String code) throws JoseException;

    Result deleteAppToken(String token);

    Result deleteUserById(long id);

    Result updateUser(User user);

    Result addUser(User role) throws JoseException;

    List<User> findUsersByIds(Set<Long> userIds);

    List<User> findUsersLikeName(String formCreateUserQuery);
}
